# Michael Depuy
# depuym@onid.orst.edu
# Cs311-400
# Homework 2

import sys
import ctypes, ctypes.util

LIMIT = 1000000 # Upper search limit
primes = []
arg = input("What prime do you want to find: ")


def findPrimeAt(prime):
    b = 0
    k = 0

    for i in range(0,len(primes)):
        if primes[i] != -1:
            b = b + 1
        if b == prime:
            break
        k = k + 1

    return primes[k]


for i in range(0,LIMIT):
    primes.append(i)

primes[0] = -1
primes[1] = -1

for i in range(2,LIMIT):
    for j in range(i*i,LIMIT,i):
        if primes[j] != -1:
            primes[j] = -1

print "The 2300th prime is", findPrimeAt(2300)

print "Prime #", arg, "is", findPrimeAt(arg)
